package com.twoGroup.boot.mapper;


import com.twoGroup.boot.pojo.LikeAndGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface LikeMapper{

    //添加到用户喜欢
    Integer addUserLike(@Param("userId") Integer userId, @Param("goodsId") Integer goodsId, @Param("shopId") Integer shopId);

    //删除喜欢
    Integer deleteLike(@Param("likeId") Integer likeId);

    //删除所有喜欢
    Integer deleteAllLike(@Param("userId") Integer userId);

    //查询该商品用户喜欢是否已经存在
    Integer selectLikeCount(@Param("userId") Integer userId, @Param("goodsId") Integer goodsId);

    //查询用户喜欢
    List<LikeAndGoods> selectAllLike(@Param("userId") Integer userId);

    //查询用户喜欢的条数
    Integer selectCount(@Param("userId") Integer userId);

}
